import request from "@/utils/request";
// 调用权限
export default {
  getList(data) {
    return request({
      url: "/api/document/",
      method: "get",
      params: data
    });
  },
  toAdd(data) {
    return request({
      url: "/api/document/",
      method: "post",
      data
    });
  },
  deleteDocument(id) {
    return request({
      url: "/api/document/" + id + "/",
      method: "delete"
    });
  },
  toEdit(id, data) {
    return request({
      url: "/api/document/" + id + "/",
      method: "put",
      data
    });
  },
  toEditAgain(id, data) {
    return request({
      url: "/api/document/" + id + "/again/",
      method: "put",
      data
    });
  },
  editDocumentSave(id, data) {
    return request({
      url: "/api/document/" + id + "/save/",
      method: "put",
      data
    });
  },
  getDocumentById(id,data) {
    return request({
      url: "/api/document/" + id + "/",
      method: "get",
      params: data
    });
  },
  //部门所有审批人和负责人合集的接口
  getDeptApprover(data) {
    return request({
      url: "/api/accounts/dept_fzr/",
      method: "get",
      params: data
    });
  },
  //关注
  collect(UUID,data) {
    return request({
      url: "/api/document/"+UUID+"/collect/",
      method: "post",
      data
    });
  },
  //取消关注
  uncollect(UUID,data) {
    return request({
      url: "/api/document/"+UUID+"/uncollect/",
      method: "post",
      data
    });
  },
  //催办
  urge(UUID,data) {
    return request({
      url: "/api/document/"+UUID+"/urge/",
      method: "post",
      data
    });
  },
  //发送小纸条
  docuemntNotice(data) {
    return request({
      url: "/api/document/notice/",
      method: "post",
      data
    });
  },
  //## 2.我收到的小纸条列表
  getDocumentNotice(data) {
    return request({
      url: "/api/document/notice/",
      method: "get",
      params: data
    });
  },
  //## 2.删除收到的单条小纸条
  deleteDocumentNotice(id,data) {
    return request({
      url: "/api/document/notice/"+id+"/",
      method: "delete",
      params: data
    });
  },
  //## 已阅
  noticeRead(id,data) {
    return request({
      url: "/api/document/notice/{"+id+"}/read/",
      method: "put",
      params: data
    });
  },
  getSecretarysList(data) {
    return request({
      url: "/api/accounts/depts_fzr/",
      method: "get",
      params: data
    });
  },
  //分发时查校领导的接口
  getAccountsRlesXld(data) {
    return request({
      url: "/api/accounts/roles/xld/",
      method: "get",
      params: data
    });
  },
  getAccountsDeptAll(data) {
    return request({
      url: "/api/accounts/dept_all/",
      method: "get",
      params: data
    });
  },
  getAccountsDeptNoFzr(data) {
    return request({
      url: "/api/accounts/dept_no_fzr/",
      method: "get",
      params: data
    });
  },
  //转发他人或多人
  addDocumentDist(data) {
    return request({
      url: "/api/document/dist/",
      method: "post",
      data
    });
  },
  getDocumentDist(data) {
    return request({
      url: "/api/document/dist/",
      method: "get",
      params: data
    });
  },
  getDocumentDistById(id,data) {
    return request({
      url: "/api/document/dist/"+id+"/",
      method: "get",
      params: data
    });
  },
  //分发传阅的统计数据
  getDocumentDistInfo(data) {
    return request({
      url: "/api/document/dist/info/",
      method: "get",
      params: data
    });
  },

  documentDistRead(id,data) {
    return request({
      url: "/api/document/dist/"+id+"/read/",
      method: "put",
      data
    });
  },
  documentFileWopi(id) {
    return request({
      url: "/api/document/file_wopi/"+id+"/",
      method: "post",
    });
  },
  getDocumentFileWopi(id) {
    return request({
      url: "/api/document/file_wopi/"+id+"/",
      method: "get",
    });
  },
  getDocumentAttachment(data) {
    return request({
      url: "/api/document/attachment/",
      method: "get",
      params: data
    });
  },
  editDocumentLevel(UUID,data) {
    return request({
      url: "/api/document/"+UUID+"/level/",
      method: "put",
      data
    });
  },
  getTicketsUserMsg(UUID,data) {
    return request({
      url: "/api/tickets/user_msg/",
      method: "get",
      params: data
    });
  },
  getDocumentQrcode(data) {
    return request({
      url: "/api/document/qrcode/",
      method: "get",
      params: data
    });
  },
  getDocumentQrcodeById(id,data) {
    return request({
      url: "/api/document/qrcode/"+id+"/",
      method: "get",
      params: data
    });
  },
  documentTempFile(data) {
    return request({
      url: "/api/document/temp_file/",
      method: "post",
      data
    });
  },
  getAliasById(data) {
    return request({
      url: "/api/accounts/id_to_alias/",
      method: "post",
      data
    });
  },
  documentArchives(id,data) {
    return request({
      url: "/api/document/archives/"+id+"/",
      method: "post",
      data
    });
  },
  //销毁
  documentDels(id,data) {
    return request({
      url: "/api/document/"+id+"/dels/",
      method: "post",
      data
    });
  },
  getDocumentSpd(id,data) {
    return request({
      url: "/api/document/spd/"+id+"/",
      method: "get",
      params:data
    });
  },
  getDocumentUpspd(id,data) {
    return request({
      url: "/api/document/"+id+"/upspd/",
      method: "post",
      data
    });
  },
  setDocuemtEdit(id,data) {
    return request({
      url: "/api/document/"+id+"/set_edit/",
      method: "put",
      data
    });
  },
  getDocumentDistRoleMsg(data) {
    return request({
      url: "/api/document/dist/role_msg/",
      method: "get",
      data
    });
  },
  documentRecall(id,data) {
    return request({
      url: "/api/document/"+id+"/recall/",
      method: "get",
      data
    });
  },
  documentChehui(id,data) {
    return request({
      url: "/api/document/"+id+"/chehui/",
      method: "get",
      data
    });
  },
};
